function removeHtmlTag(strx,chop){
if(strx.indexOf("<")!=-1)
{
var s = strx.split("<");
for(var i=0;i<s.length;i++){
if(s[i].indexOf(">")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx = s.join("");
}
chop = (chop < strx.length-1) ? chop : strx.length-2;
while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;
strx = strx.substring(0,chop-15);
return strx+'';
}
function createSummaryAndThumb(pID, pURL){
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
if(img.length<=0) {
imgtag = '<a href="'+ pURL +'"><div class="lstanmadd-lston"></div><img src="https://lh3.googleusercontent.com/-_3FDJcVDmj0/T93_6oCL5dI/AAAAAAAAG2w/pllQAcj0yZI/s207/nodp.jpg" height="250" width="'+img_thumb_width+'px" /></a>';
summ = summary_txt;
}
if(img.length>=1) {
imgtag = '<a href="'+ pURL +'"><div class="lstanmadd-lston"></div><img src="'+img[0].src+'" height="250" width="'+img_thumb_width+'px"/></a>';
summ = summary_txt;
}
var summary = imgtag + '<div>' + removeHtmlTag(div.innerHTML,summ) + '</div>';
div.innerHTML = summary;
}